<!--决算金额-->
<template>
  <div class="save-balance-money ne-relative"
       v-loading="loading"
       element-loading-customClass="ne-loading"
       element-loading-background="rgba(255, 255, 255, 0.6)"
  >
    <el-form
        ref="TcForm2"
        label-position="left"
        label-width="1.5rem"
        :model="Form1"
        class="form"
    >
      <el-row>
        <tc-form2 :form="Form1"  :star-index=0 :end-index=7>
        </tc-form2>
      </el-row>
      <el-row class="ne-col2-gutter-8 flex">
        <el-col
            :span="8"
            class="line ne-relative ne-border-bold ne-padding-t-20"
        >
          <h2 class="ne-title-v5 green">预收费单</h2>
          <tc-form2 :form="Form1" :star-index=7 :end-index=20>
          </tc-form2>
          <div class="ne-bg ne-bg-top"></div>
          <div class="ne-bg ne-bg-bottom"></div>
        </el-col>
        <el-col
            :span="8"
            class="line ne-relative ne-border-bold ne-padding-t-20"
        >
          <h2 class="ne-title-v5 orange">决算金额</h2>
          <tc-form2 :form="Form1"  :star-index=20 :end-index=33>
          </tc-form2>
          <div class="ne-bg ne-bg-top"></div>
          <div class="ne-bg ne-bg-bottom"></div>
        </el-col>
        <el-col
            :span="8"
            class="line ne-relative ne-border-bold ne-padding-t-20"
        >
          <h2 class="ne-title-v5 blue">最终金额</h2>
          <tc-form2 :form="Form1"  :star-index=33 :end-index=42>
          </tc-form2>
          <div class="ne-bg ne-bg-top"></div>
          <div class="ne-bg ne-bg-bottom"></div>
        </el-col>
      </el-row>
      <el-row>
        <tc-form2 :form="Form1"  :star-index=42 :end-index=50>
        </tc-form2>
      </el-row>
    </el-form>
    <el-row class="fixed">
      <el-col :span="24" class="text-center">
        <el-button type="primary" size="medium" @click="submitFun">保存</el-button>
        <el-button size="medium" @click="closeFun">取消</el-button>
      </el-col>
    </el-row>
  </div>
</template>
<script>
import TcForm2 from "@/components/public/TcForm2";
import CustOrderService from "@/api/order/CustOrderService";
import requestUtil from '@/utils/requestEnc';
import CommonUtil from '@/utils/common';
import {mapState} from 'vuex';
import custOrderDetail from '@/mixins/custorder/custOrderDetail';
export default {
  name: "saveBalanceMoney",
  data() {
    return {
      loading: false,
      Form1: {
        "2004-100010135": {
          "type": "Ipt",
          "id": "2004-100010135",
          "value": "",
          "name": "流水号",
          "fieldId": "ORDER_NBR",
          "tableName": "CUSTOMER_ORDER",
          "colId": "CUST_SO_NUMBER",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 6,
          "relIds": "100012076;100011646;100011007;141000009;100010651;100012627",
          "isSave": false
        },
        "2004-141000021": {
          "type": "Ipt",
          "id": "2004-141000021",
          "value": "",
          "name": "客户名称",
          "fieldId": "CUST_NAME",
          "tableName": "CUSTOMER_ORDER",
          "colId": "CUST_NAME",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 6,
          "isSave": false
        },
        "2004-100010037": {
          "type": "Ipt",
          "id": "2004-100010037",
          "value": "",
          "name": "合同编码",
          "fieldId": "CONTACT_CD",
          "tableName": "CUSTOMER_ORDER",
          "colId": "CONTACT_CD",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 6,
          "isSave": false
        },
        "2004-100010762": {
          "type": "Ipt",
          "id": "2004-100010762",
          "value": "",
          "name": "联系人姓名",
          "fieldId": "THR_TER_LINK_MAN",
          "tableName": "ORDER_CONTACT_INFO",
          "colId": "CONTACT_NAME",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 6,
          "isSave": false
        },
        "2004-141000025": {
          "type": "Ipt",
          "id": "2004-141000025",
          "value": "",
          "name": "联系电话",
          "fieldId": "OFFICE_PHONE",
          "tableName": "ORDER_CONTACT_INFO",
          "colId": "OFFICE_PHONE",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 6,
          "isSave": false
        },
        "2004-100010102": {
          "type": "Ipt",
          "id": "2004-100010102",
          "value": "",
          "name": "业务类型",
          "fieldId": "PRODUCT_ID",
          "tableName": "CUSTOMER_ORDER",
          "colId": "PRODUCT_ID",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 6,
          "relIds": "141000010;100012610;100010009;100011534;100011056;100011694;100012993;100010007;100010008;100012516;100012632;100012493;100012494",
          "isSave": false
        },
        "2004-100012563": {
          "type": "Ipt",
          "id": "2004-100012563",
          "value": "",
          "name": "设备供应商",
          "fieldId": "LINK_MAN_OPP",
          "tableName": "CUSTOMER_ORDER",
          "colId": "100012563",
          "colType": "T",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 6,
          "isSave": false
        },
        "2006-100010070": {
          "type": "Ipt",
          "id": "2006-100010070",
          "value": "",
          "name": "城市",
          "fieldId": "AREA_ID",
          "tableName": "CUSTOMER_ORDER",
          "colId": "LOCATION_ID",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 24,
          "isSave": false
        },
        "2006-100013338": {
          "type": "Ipt",
          "id": "2006-100013338",
          "value": "",
          "name": "工料费",
          "fieldId": "MAT_MONEY",
          "tableName": "ACCT_ITEM",
          "colId": "AMOUNT",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": false,
          "span": 24,
          "isSave": false
        },
        "2006-100012523": {
          "type": "Ipt",
          "id": "2006-100012523",
          "value": "",
          "name": "调测费",
          "fieldId": "ONCE_MONEY_TEST",
          "tableName": "ACCT_ITEM",
          "colId": "AMOUNT",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 24,
          "isSave": false
        },
        "2006-100012569": {
          "type": "Ipt",
          "id": "2006-100012569",
          "value": "",
          "name": "手续费",
          "fieldId": "ONCE_MONEY_PRO",
          "tableName": "ACCT_ITEM",
          "colId": "AMOUNT",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": false,
          "span": 24,
          "isSave": false
        },
        "2006-100012911": {
          "type": "Ipt",
          "id": "2006-100012911",
          "value": "",
          "name": "装机优惠率(%)",
          "fieldId": "DISCOUNT_TES",
          "tableName": "ACCT_ITEM",
          "colId": "RATIO",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 24,
          "isSave": false
        },
        "2006-100010636": {
          "type": "Ipt",
          "id": "2006-100010636",
          "value": "",
          "name": "单价",
          "fieldId": "UNIT_PRICE",
          "tableName": "ACCT_ITEM",
          "colId": "100010636",
          "colType": "T",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 24,
          "isSave": false
        },
        "2006-100010735": {
          "type": "Ipt",
          "id": "2006-100010735",
          "value": "",
          "name": "工程费",
          "fieldId": "ENG_MONEY",
          "tableName": "ACCT_ITEM",
          "colId": "AMOUNT",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": false,
          "span": 24,
          "isSave": false
        },
        "2006-100012600": {
          "type": "Ipt",
          "id": "2006-100012600",
          "value": "",
          "name": "工程费优惠率(%)",
          "fieldId": "DISCOUNT_ENG",
          "tableName": "ACCT_ITEM",
          "colId": "RATIO",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": false,
          "span": 24,
          "isSave": false
        },
        "2006-100010763": {
          "type": "Ipt",
          "id": "2006-100010763",
          "value": "",
          "name": "设备费",
          "fieldId": "DEV_MONEY",
          "tableName": "ACCT_ITEM",
          "colId": "AMOUNT",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": false,
          "span": 24,
          "isSave": false
        },
        "2006-100012627": {
          "type": "Ipt",
          "id": "2006-100012627",
          "value": "",
          "name": "设备费优惠率(%)",
          "fieldId": "DISCOUNT_DEV",
          "tableName": "ACCT_ITEM",
          "colId": "RATIO",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": false,
          "span": 24,
          "isSave": false
        },
        "2006-100010651": {
          "type": "select",
          "id": "2006-100010651",
          "value": "156",
          "name": "一次性费用币种",
          "fieldId": "DATA_CENTER_M_CUR",
          "tableName": "ACCT_ITEM",
          "colId": "CURRENCY",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": false,
          "show": true,
          "span": 24,
          "options": [{label:'人民币',value:'156'},{label:'美元',value:'840'}],
          "isSave": false
        },
        "2006-100013295": {
          "type": "Ipt",
          "id": "2006-100013295",
          "value": "",
          "name": "实际收款金额",
          "fieldId": "FACT_MONEY",
          "tableName": "ACCT_ITEM",
          "colId": "100013295",
          "colType": "T",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 24,
          "isSave": false
        },
        "2006-100013365": {
          "type": "Ipt",
          "id": "2006-100013365",
          "value": "",
          "name": "收款单位",
          "fieldId": "CHARGE_ORG_ID",
          "tableName": "ACCT_ITEM_ORG",
          "colId": "CHARGE_ORG_CODE",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 24,
          "isSave": false
        },
        "2007-100010070": {
          "type": "Ipt",
          "id": "2007-100010070",
          "value": "",
          "name": "城市",
          "fieldId": "AREA_ID",
          "tableName": "ORDER_TASK_ATTR",
          "colId": "LOCATION_ID",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 24,
          "isSave": false
        },
        "2007-100013338": {
          "type": "Ipt",
          "id": "2007-100013338",
          "value": "0",
          "name": "工料费",
          "fieldId": "MAT_MONEY",
          "tableName": "ORDER_TASK_ATTR",
          "colId": "AMOUNT",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": false,
          "show": false,
          "span": 24,
          "isSave": false
        },
        "2007-100012523": {
          "type": "Ipt",
          "id": "2007-100012523",
          "value": "0",
          "name": "调测费",
          "fieldId": "ONCE_MONEY_TEST",
          "tableName": "ORDER_TASK_ATTR",
          "colId": "AMOUNT",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": false,
          "show": true,
          "span": 24,
          "isSave": false
        },
        "2007-100012569": {
          "type": "Ipt",
          "id": "2007-100012569",
          "value": "0",
          "name": "手续费",
          "fieldId": "ONCE_MONEY_PRO",
          "tableName": "ORDER_TASK_ATTR",
          "colId": "AMOUNT",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": false,
          "show": false,
          "span": 24,
          "isSave": false
        },
        "2007-100012911": {
          "type": "Ipt",
          "id": "2007-100012911",
          "value": "0",
          "name": "装机优惠率(%)",
          "fieldId": "DISCOUNT_TES",
          "tableName": "ORDER_TASK_ATTR",
          "colId": "RATIO",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": false,
          "show": true,
          "span": 24,
          "isSave": false
        },
        "2007-100010636": {
          "type": "Ipt",
          "id": "2007-100010636",
          "value": "0",
          "name": "单价",
          "fieldId": "UNIT_PRICE",
          "tableName": "ACCT_ITEM",
          "colId": "100010636",
          "colType": "T",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 24,
          "isSave": false
        },
        "2007-100010735": {
          "type": "Ipt",
          "id": "2007-100010735",
          "value": "0",
          "name": "工程费",
          "fieldId": "ENG_MONEY",
          "tableName": "ORDER_TASK_ATTR",
          "colId": "AMOUNT",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": false,
          "show": false,
          "span": 24,
          "isSave": false
        },
        "2007-100012600": {
          "type": "Ipt",
          "id": "2007-100012600",
          "value": "0",
          "name": "工程费优惠率(%)",
          "fieldId": "DISCOUNT_ENG",
          "tableName": "ORDER_TASK_ATTR",
          "colId": "RATIO",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": false,
          "show": false,
          "span": 24,
          "isSave": false
        },
        "2007-100010763": {
          "type": "Ipt",
          "id": "2007-100010763",
          "value": "0",
          "name": "设备费",
          "fieldId": "DEV_MONEY",
          "tableName": "ORDER_TASK_ATTR",
          "colId": "AMOUNT",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": false,
          "show": false,
          "span": 24,
          "isSave": false
        },
        "2007-100012627": {
          "type": "Ipt",
          "id": "2007-100012627",
          "value": "0",
          "name": "设备费优惠率(%)",
          "fieldId": "DISCOUNT_DEV",
          "tableName": "ORDER_TASK_ATTR",
          "colId": "RATIO",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": false,
          "show": false,
          "span": 24,
          "isSave": false
        },
        "2007-100010651": {
          "type": "select",
          "id": "2007-100010651",
          "value": "156",
          "name": "一次性费用币种",
          "fieldId": "DATA_CENTER_M_CUR",
          "tableName": "ORDER_TASK_ATTR",
          "colId": "CURRENCY",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": false,
          "show": true,
          "span": 24,
          "options": [{label:'人民币',value:'156'},{label:'美元',value:'840'}],
          "isSave": false
        },
        "2007-100013295": {
          "type": "Ipt",
          "id": "2007-100013295",
          "value": "0",
          "name": "实际收款金额",
          "fieldId": "FACT_MONEY",
          "tableName": "ACCT_ITEM",
          "colId": "100013295",
          "colType": "T",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 24,
          "isSave": false
        },
        "2007-100013365": {
          "type": "Ipt",
          "id": "2007-100013365",
          "value": "",
          "name": "收款单位",
          "fieldId": "CHARGE_ORG_ID",
          "tableName": "ORDER_TASK_ATTR",
          "colId": "CHARGE_ORG_CODE",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 24,
          "isSave": false
        },
        "2008-100010640": {
          "type": "Ipt",
          "id": "2008-100010640",
          "value": "",
          "name": "城市",
          "fieldId": "FRI_AREA_ID",
          "tableName": "ORDER_TASK_ATTR",
          "colId": "LOCATION_ID",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 24,
          "isSave": false
        },
        "2008-100012903": {
          "type": "Ipt",
          "id": "2008-100012903",
          "value": "0",
          "name": "决算工料费",
          "fieldId": "ONCE_MONEY_MAT_FI",
          "tableName": "ACCT_ITEM",
          "colId": "AMOUNT",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": false,
          "span": 24,
          "acctItemId": "2002000",
          "isSave": true
        },
        "2008-100012906": {
          "type": "Ipt",
          "id": "2008-100012906",
          "value": "0",
          "name": "决算调测费",
          "fieldId": "ONCE_MONEY_TEST_FI",
          "tableName": "ACCT_ITEM",
          "colId": "AMOUNT",
          "colType": "C",
          "attrRoleCd": "",
          "acctItemId": "2006000",
          "readonly": true,
          "show": true,
          "span": 24,
          "isSave": true
        },
        "2008-100012905": {
          "type": "Ipt",
          "id": "2008-100012905",
          "value": "0",
          "name": "决算手续费",
          "fieldId": "ONCE_MONEY_PRO_FI",
          "tableName": "ACCT_ITEM",
          "colId": "100012905",
          "colType": "C",
          "attrRoleCd": "",
          "acctItemId": "2005000",
          "readonly": true,
          "show": false,
          "span": 24,
          "isSave": true
        },
        "2008-100012904": {
          "type": "Ipt",
          "id": "2008-100012904",
          "value": "0",
          "name": "决算工程费",
          "fieldId": "ONCE_MONEY_ENG_FI",
          "tableName": "ACCT_ITEM",
          "colId": "AMOUNT",
          "colType": "C",
          "attrRoleCd": "",
          "acctItemId": "2009000",
          "readonly": true,
          "show": false,
          "span": 24,
          "isSave": true
        },
        "2008-100012907": {
          "type": "Ipt",
          "id": "2008-100012907",
          "value": "0",
          "name": "决算设备费",
          "fieldId": "ONCE_MONEY_DEV_FI",
          "tableName": "ACCT_ITEM",
          "colId": "AMOUNT",
          "colType": "C",
          "attrRoleCd": "",
          "acctItemId": "2008000",
          "readonly": true,
          "show": false,
          "span": 24,
          "isSave": true
        },
        "2008-100010651": {
          "type": "select",
          "id": "2008-100010651",
          "value": "156",
          "name": "一次性费用币种",
          "fieldId": "DATA_CENTER_M_CUR",
          "tableName": "ACCT_ITEM",
          "colId": "CURRENCY",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": false,
          "show": true,
          "span": 24,
          "options": [{label:'人民币',value:'156'},{label:'美元',value:'840'}],
          "isSave": false
        },
        "2008-100013295": {
          "type": "Ipt",
          "id": "2008-100013295",
          "value": "0",
          "name": "实际收款金额",
          "fieldId": "FACT_MONEY",
          "tableName": "ACCT_ITEM",
          "colId": "100013295",
          "colType": "T",
          "attrRoleCd": "",
          // "readonly": true,
          "show": true,
          "span": 24,
          "isSave": false
        },
        "2008-100013365": {
          "type": "Ipt",
          "id": "2008-100013365",
          "value": "",
          "name": "收款单位",
          "fieldId": "CHARGE_ORG_ID",
          "tableName": "ACCT_ITEM_ORG",
          "colId": "CHARGE_ORG_CODE",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 24,
          "isSave": false
        },
        "2004-100012377": {
          "type": "Ipt",
          "id": "2004-100012377",
          "value": "",
          "name": "填报人",
          "fieldId": "USER_NAME",
          "tableName": "ORDER_TASK",
          "colId": "USER_NAME",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": true,
          "show": true,
          "span": 6,
          "isSave": true
        },
        "2004-100012411": {
          "type": "Ipt",
          "id": "2004-100012411",
          "value": "",
          "name": "填报日期",
          "fieldId": "TASK_OPR_DATE",
          "tableName": "ORDER_TASK",
          "colId": "100012411",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": false,
          "show": true,
          "span": 6,
          "isSave": false,
          "marginRight":'50%'
        },
        "2004-100012342": {
          "type": "textarea",
          "id": "2004-100012342",
          "value": "",
          "name": "备注",
          "fieldId": "TASK_COMMENT",
          "tableName": "ORDER_TASK",
          "colId": "TASK_COMMENT",
          "colType": "C",
          "attrRoleCd": "",
          "readonly": false,
          "show": true,
          "span": 12,
          "isSave": true
        },
        "2008-100013076": {
          "type": "Ipt",
          "id": "2008-100013076",
          "value": "",
          "name": "",
          "fieldId": "DISCOUNT_TES_A",
          "tableName": "ACCT_ITEM",
          "colId": "100013076",
          "colType": "T",
          "attrRoleCd": "",
          "show": false,
          "isSave": false
        },
        "2008-100010636": {
          "type": "Ipt",
          "id": "2008-100010636",
          "value": "",
          "name": "",
          "fieldId": "UNIT_PRICE",
          "tableName": "ACCT_ITEM",
          "colId": "100010636",
          "colType": "T",
          "attrRoleCd": "",
          "show": false,
          "isSave": false
        },
        "2008-100013071": {
          "type": "Ipt",
          "id": "2008-100013071",
          "value": "",
          "name": "",
          "fieldId": "DISCOUNT_ENG_A",
          "tableName": "ACCT_ITEM",
          "colId": "RATIO",
          "colType": "C",
          "attrRoleCd": "",
          "show": false,
          "isSave": false
        },
        "2008-100013069": {
          "type": "Ipt",
          "id": "2008-100013069",
          "value": "",
          "name": "",
          "fieldId": "DISCOUNT_DEV_A",
          "tableName": "ACCT_ITEM",
          "colId": "RATIO",
          "colType": "C",
          "attrRoleCd": "",
          "show": false,
          "isSave": true
        },
        "2004-100012393": {
          "type": "Ipt",
          "id": "2004-100012393",
          "value": "",
          "name": "",
          "fieldId": "USER_ID",
          "tableName": "ORDER_TASK",
          "colId": "100012393",
          "colType": "C",
          "attrRoleCd": "",
          "show": false,
          "isSave": false
        },
        "2004-100012371": {
          "type": "Ipt",
          "id": "2004-100012371",
          "value": "",
          "name": "",
          "fieldId": "LOOP_MONEY_MAIN",
          "tableName": "PROC_PROD_OFFER_FEE_INFO",
          "colId": "AMOUNT",
          "colType": "C",
          "attrRoleCd": "",
          "show": false,
          "isSave": true
        }
      }
    ,odtals:null
      ,rowCd:null
    }
  },
  props: {
    ODKInfo: {
      type: Object
    },
    CTOInfo: {
      type: [Object,Array]
    }
  },
  computed:{
    ...mapState('user',['user']),
    ...mapState('orders',['orderPosInfo']),
    listenChange(){
      const J_glf = this.Form1['2007-100013338'].value,
            J_tcf = this.Form1['2007-100012523'].value,
            J_sxf = this.Form1['2007-100012569'].value,
            J_jzper = this.Form1['2007-100012911'].value,
            J_gcf = this.Form1['2007-100010735'].value,
            J_gcfper = this.Form1['2007-100012600'].value,
            J_sbf = this.Form1['2007-100010763'].value,
            J_sbfper = this.Form1['2007-100012627'].value;
      return {J_glf,J_tcf,J_sxf,J_jzper,J_gcf,J_gcfper,J_sbf,J_sbfper}
      /*
       ******决算单****************
      * 工料费 J_glf
      * 调测费 J_tcf
      * 手续费 J_sxf
      * 装机优惠率 J_jzper
      * 工程费 J_gcf
      * 工程费优惠率 J_gcfper
      * 设备费 J_sbf
      * 设备费优惠率 J_sbfper
      * */
    }
  },
  mounted() {

  },
  created() {
    this.getCustomerOrderDetail(this.CTOInfo,this.ODKInfo);
    this.addRowCd(this.Form1);
  },
  components: {TcForm2,},
  methods: {
    async getCustomerOrderDetail(CTOInfo,ODKInfo){
      this.loading = true;
      let {custSoNumber,batchNbr,custId} = CTOInfo,
          orderItemIds=CTOInfo.orderItemId,
          scopeInfos=[],
          keyarr = {};
      for(var key in this.Form1){
        let item = this.Form1[key];
        if(item.tableName){
          let newkey = requestUtil.toHump(item.tableName)+'s';
          if(!keyarr[newkey]){
            keyarr[newkey]=1;
            scopeInfos.push({
              scope:newkey
            });
          }
        };
      }
      const result=await CustOrderService.qryCustomerOrderDetail({custSoNumber,batchNbr,orderItemIds,custId,scopeInfos});
      this.loading = false;
      for(var key in result.orderDetails[0]){
        let obj = result.orderDetails[0][key];
        if(key=='acctItems'){
          for(var i=0;i<obj.length;i++){
            if(this.rowCd == obj[i].acctTypeCd){
              this.ODKInfo.acctItemOrgId = obj[i].acctItemOrgId;
              
              if("2002000"== obj[i].acctItemTypeId){//  工料费
                this.Form1['2006-100013338'].value=obj[i].amount;
                this.Form1['2006-100012911'].value=obj[i].ratio;
                this.Form1['2006-100010651'].value=obj[i].currency;
              }else if("2005000"== obj[i].acctItemTypeId){// 手续费
                this.Form1['2006-100012569'].value=obj[i].amount;
              }else if("2006000"== obj[i].acctItemTypeId){//调测费
                this.Form1['2006-100012523'].value=obj[i].amount;
              }else if("2008000"== obj[i].acctItemTypeId){//设备费
                this.Form1['2006-100012627'].value=obj[i].ratio;
                this.Form1['2006-100010763'].value=obj[i].amount;
              }else if("2009000"== obj[i].acctItemTypeId){//工程费
                this.Form1['2006-100010735'].value=obj[i].amount;
                this.Form1['2006-100012600'].value=obj[i].ratio;
              }
            }
          }
        }else if(key=='acctItemOrgs'){
          for(var i=0;i<obj.length;i++){
            if(obj[i].chargeOrgCd==this.rowCd){
              const res1 = await CustOrderService.getExecuteSqlList({
                interFaceType:"ORDER",
                sqlId:"2021061502",
                paramStr:"attrValueCd:"+obj[i].chargeOrgCode
              });
              if(res1.meta.resCode=='0'){
                this.Form1['2006-100013365'].value=res1.meta.resList.executeSqlResps[0].attrValue;
                this.Form1['2007-100013365'].value=res1.meta.resList.executeSqlResps[0].attrValue;
                this.Form1['2008-100013365'].value=res1.meta.resList.executeSqlResps[0].attrValue;
              }
              break;
            }
          }
        }else if(key=='orderTasks'){
          for(var i=0;i<obj.length;i++){
            if(ODKInfo.taskId == obj[i].taskId){
              this.CTOInfo.orderTaskId = obj[i].orderTaskId;
              break;
            }
          }
        }else if(key=='customerOrders'){
          for(var i=0;i<obj.length;i++){
            this.Form1['2004-141000021'].value=obj[i].custName;
            this.Form1['2004-100010135'].value=obj[i].custSoNumber;
            this.Form1['2004-100010037'].value=obj[i].contactCd;
            this.Form1['2004-100010102'].value=obj[i].prodId?obj[i].prodId:"";
            break;
          }
        }else if(key=='orderContactInfos'){
          for(var i=0;i<obj.length;i++){
            if("1" == obj[i].contactType){
              this.Form1['2004-100010762'].value=obj[i].contactName;
              this.Form1['2004-141000025'].value=obj[i].contactPhone;
              break;
            }
          }
        }
      };
      this.JZ_Fun();
    },
    addRowCd(Form){
      let {taskId} = this.ODKInfo,CD = null;
      if (taskId=="TACHE00130001" || taskId == "TACHE00130004") {
        CD = "100";
      } else {
        CD = "200";
      }
      this.rowCd = CD;
      for(var key in Form){
        Form[key].attrRoleCd = CD;
      }
    },
    async submitFun(){
      this.loading = true;
      let base={
        userName: this.user.staffName,
        userId: this.user.staffId,
        // acctItemOrgId:this.CTOInfo.acctItemOrgId,
        actType: 'MOD',
        oneOrmany:'one'
      };
      let {userId,orgId} = base,
          {orderItemSeqs,custSoNumber,orderItemId,orderItemIds,custId} = this.CTOInfo,
          {taskId,activityId,processInstId,orderAuditId} = this.ODKInfo;
          
            
      let param = requestUtil.paramEnc(this.Form1,Object.assign(this.ODKInfo,this.CTOInfo,base,this.odtals));
      let allParam = {orderAuditId,orderItemIds,custId,orderItemSeqs,custSoNumber,orderItemId,activityId,processInstId,userId,orgId,taskId,...base,...param};
      
      const result = await CustOrderService.saveBalanceMoney(allParam);
      this.loading = false;
      try {
        if(result.meta.resultCode == 0){
          this.$message({
            type: 'success',
            message: '保存成功!'
          });
          this.$emit('update:show',false);
        }else{
          this.$message({
            showClose: true,
            message: result.meta.resultMsg,
            type: 'error'
          });
        }
      } catch {
        this.$message({
          showClose: true,
          message: 'code:'+result.code+'  msg:'+result.msg,
          type: 'error'
        });
      }
    },
    closeFun(){
      this.$emit('update:show',false)
    },
    JZ_Fun(){
      // 决算单
      const J_jzper = parseFloat(this.Form1['2007-100012911'].value),
            J_gcfper = parseFloat(this.Form1['2007-100012600'].value),
            J_sbfper = parseFloat(this.Form1['2007-100012627'].value),
            J_glf_p = parseFloat(this.numPer(this.Form1['2007-100013338'].value,J_jzper)),
            J_tcf_p = parseFloat(this.numPer(this.Form1['2007-100012523'].value,J_jzper)),
            J_sxf_p = parseFloat(this.numPer(this.Form1['2007-100012569'].value,J_jzper)),
            J_gcf_p = parseFloat(this.numPer(this.Form1['2007-100010735'].value,J_gcfper)),
            J_sbf_p = parseFloat(this.numPer(this.Form1['2007-100010763'].value,J_sbfper)),
            J_djMon = parseFloat(CommonUtil.numAdd([J_glf_p,J_tcf_p,J_sxf_p])),
            J_allMon = parseFloat(CommonUtil.numAdd([J_djMon,J_gcf_p,J_sbf_p]));
      // 预收费单
      const Y_jzper = parseFloat(this.Form1['2006-100012911'].value),
            Y_gcfper = parseFloat(this.Form1['2006-100012600'].value),
            Y_sbfper = parseFloat(this.Form1['2006-100012627'].value),
            Y_glf_p = this.numPer(this.Form1['2006-100013338'].value,Y_jzper),
            Y_tcf_p = this.numPer(this.Form1['2006-100012523'].value,Y_jzper),
            Y_sxf_p = this.numPer(this.Form1['2006-100012569'].value,Y_jzper),
            Y_gcf_p = this.numPer(this.Form1['2006-100010735'].value,Y_gcfper),
            Y_sbf_p = this.numPer(this.Form1['2006-100010763'].value,Y_sbfper),
            Y_djMon = parseFloat(CommonUtil.numAdd([Y_glf_p,Y_tcf_p,Y_sxf_p])),
            Y_allMon = parseFloat(CommonUtil.numAdd([Y_djMon,Y_gcf_p,Y_sbf_p]));
      // 预收费单单价
      this.Form1['2006-100010636'].value = parseFloat(Number(Y_djMon).toFixed(2));
      // 预收费单 实际收款金额
      this.Form1['2006-100013295'].value = parseFloat(Number(Y_allMon).toFixed(2));
      // 决算单单价
      this.Form1['2007-100010636'].value = parseFloat(Number(J_djMon).toFixed(2));
      // 决算单 实际收款金额
      this.Form1['2007-100013295'].value = parseFloat(Number(J_allMon).toFixed(2));
      // 工料费
      const G_glf = CommonUtil.numSub(J_glf_p,Y_glf_p),
            G_tcf = CommonUtil.numSub(J_tcf_p,Y_tcf_p),
            G_sxf = CommonUtil.numSub(J_sxf_p,Y_sxf_p),
            G_gcf = CommonUtil.numSub(J_gcf_p,Y_gcf_p),
            G_sbf = CommonUtil.numSub(J_sbf_p,Y_sbf_p);
      this.Form1['2008-100012903'].value = parseFloat(Number(G_glf).toFixed(2));
      this.Form1['2008-100012906'].value = parseFloat(Number(G_tcf).toFixed(2));
      this.Form1['2008-100012905'].value = parseFloat(Number(G_sxf).toFixed(2));
      this.Form1['2008-100012904'].value = parseFloat(Number(G_gcf).toFixed(2));
      this.Form1['2008-100012907'].value = parseFloat(Number(G_sbf).toFixed(2));
      this.Form1['2008-100013295'].value = parseFloat(CommonUtil.numAdd([G_glf , G_tcf , G_sxf , G_gcf , G_sbf]).toFixed(2));
    },
    numPer(num,per){
      if(!num){num=0;}
      if(!per){per=0;}
      let a = CommonUtil.numMulti(Number(num),(100 - Number(per)));
      return a/100;
    }
  },
  watch: {
    listenChange:{
      handler(val,oldVal) {
        this.JZ_Fun();
      },
      deep:true
    }
  }
}
</script>

<style lang="scss" scoped>
.save-balance-money{
  height: 85vh;
  padding-bottom: .5rem;
  .ne-title-v5{
    display: inline-block;
    width: auto;
    padding: .05rem .1rem;
    margin-left: .2rem;
    font-size: $fontSize_v2;
    font-weight: 550;
    border-radius: .02rem;
    &.green{
      color: #7dc855;
    }
  }
  .form{
    height: 100%;
    overflow-y:auto;
  }
  ::v-deep .el-tabs__content{
    min-height: 3rem;
  }
}
.fixed{
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
}
</style>
